Usage

In order to use XType in your application you need to have a XML representation of your java object in a org.w3c.dom.Element object. You can do this with the help of XMLUtil (or directly via the DOM API). The following code uses XMLUtil to read the data from an XML file and to get the an org.w3c.dom.node instance from this file.

XMLUtil util = new XMLUtil("test/net/wangs/xtype/core/XTypeTest.xml");

Node node = util.getNode("/examples/item", 1);

If your object should be a vector you can now call XType to extract the data from the XML element and to create the object you want to have:

Vector obj= (Vector)XType.getObjectFromXML((Element)node, "java.util.Collection", "item");

That's it. You now have your vector object.